package org.example.dingtalkintegrationservice.exception


import org.slf4j.MDC;
//@Slf4j
 class GroovyExecutionException extends RuntimeException{
    public String errorLocation;
     public String errorMethod;
//     public String errorType;
    public String requestId;

     GroovyExecutionException(String msg, String errorLocation="", Throwable cause=null) {
        super(msg,cause);
         this.errorLocation=errorLocation
         String requestId= MDC.get("requestId")
        this.requestId=requestId
    }
     public void addErrorMethod(String errorMethod){
         this.errorMethod=errorMethod;
//        message+=" in method:%s".formatted(errorMethod)
     }
//     public void addRequestId(String requestId){
//         message+=" of requestId:%s".formatted(requestId);
//     }
//    public ExecuationException(String msg,Throwable cause){
//        super(msg,cause);
//    }
//    public ExecuationException(String msg,String errorLocation){
//        super(msg);
//        this.errorLocation=errorLocation;
//    }
//     @Override
//     public String toString() {
//         Map<String,Object> output=new HashMap<>()
//         output.put("type","ExecutionException")
//         output.put("errorLocation",errorLocation)
////         output.put("requestId")
//         output.put("")
//         return "ExecuationException{" +
//                 "errorLocation='" + errorLocation + '\'' +
//                 '},'+super.toString();
//     }
 }
